<template>
  <div class="product-item">
    <!-- 上方店铺名 -->
    <div class="top">
      <img src="@/assets/店铺@2x.png" />
      <span class="text fz14">花栩初</span>
      <span class="right">买家已付款</span>
    </div>
    <div class="product" v-for="(item, index) in showItem" :key="index">
      <!-- 左边图片 -->
      <div class="product-left">
        <img :src="item.goodsShow[0].url" />
        <!-- <img :src="productItem.src" /> -->
      </div>
      <!-- 右上方文本 -->
      <div class="text">
        <div class="titel ele fz14">
          {{ item.goods_name }}
        </div>
        <!-- 规格 -->
        <span class="specification fz12">{{ item.goods_standard }} </span>
        <div class="info">
          <span class="fz16">￥{{ item.goods_price }} </span>
          <span class="number">
            <span class="supplement fz14">共{{ item.goods_num }}件</span>
          </span>
        </div>
      </div>
    </div>
    <!-- 下方按钮 -->
    <div class="bottomBtn" v-if="selectNum != '1'">
      <van-button v-if="selectNum == '2'" color="#622CCC" plain
        >确认收货</van-button
      >
      <div v-if="selectNum == '5'" class="success">
        <van-button color="#622CCC" plain>再次购买</van-button>
        <van-button color="#DBD9DE" class="cloud" plain>加入云仓</van-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'cloudItem',
  props: ['productItem', 'selectNum', 'showItem'],
  data() {
    return {
      status: '',
      search: '',
      showItem: '' //展示的数据
      //   name: '待发货',
    }
  }
}
</script>

<style lang="less" scoped>
//   商品列表
.product-item {
  width: 351px;
  position: relative;
  // height: 426px;
  background: #fff;
  border-radius: 9px;
  padding: 12px;
  margin-bottom: 12px;
  .top {
    width: 100%;
    height: 36px;
    line-height: 36px;
    display: flex;
    align-items: center;
    position: relative;
    span {
      vertical-align: middle;
      margin-left: 1px;
      font-weight: 500;
    }
    img {
      width: 18px;
      height: 18px;
    }
    .right {
      position: absolute;
      right: 0;
      font-size: 12px;
      font-weight: 400;
      color: #ff6400;
    }
  }
  // 底部总价
  //   .press {
  //     width: 100%;
  //     height: 20px;
  //     line-height: 20px;
  //     text-align: right;

  //     //   background-color: #ff3040;
  //     span {
  //       &:first-child {
  //         color: #afabb7;
  //       }
  //       &:last-child {
  //         color: #ff6400;
  //       }
  //     }
  //   }
}
.product {
  margin-bottom: 12px;
  border-radius: 8px;
  padding: 12px 0;
  width: 351px;
  height: 114px;
  display: flex;
  position: relative;
  // height: 426px;
  border-radius: 9px;

  .product-left {
    margin-right: 12px;
    width: 90px;
    height: 90px;
    object-fit: cover;
    img {
      width: 100%;
      height: 90px;
    }
  }
  .text {
    // float: left;
    // vertical-align: center;
    position: relative;
    height: 24px;
    width: 225px;
    .titel {
      width: 225px;
      height: 20px;
      font-weight: 400;
      line-height: 20px;
    }
    .specification {
      position: absolute;
      top: 28px;
      left: 0;
      height: 18px;
      line-height: 18px;
      background: #f7f6fb;
      border-radius: 4px;
      text-align: center;
      color: #665e75;
      padding: 0 8px;
    }
    .right {
      position: absolute;
      top: 28px;
      left: auto;
      right: 0;
      color: #afabb7;
      background: #fff;
    }
    .info {
      position: absolute;
      top: 70px;
      width: 225px;
      height: 24px;
      //   color: #ff6400;
      //   overflow: hidden;
      font-weight: 600;
      text-align: end;
      .fz16 {
        float: left;
        font-weight: 400;
        color: #ff6400;
      }
      .number {
        float: right;
        height: 24px;
        display: flex;
        justify-content: center;
        align-items: center;
        .supplement {
          font-weight: 400;
          color: #afabb7;
        }
      }
      //   .number {
      //     display: inline-block;
      //     width: 170px;
      //     position: absolute;
      //     .supplement {
      //       color: #665e75;
      //       font-size: 12px;
      //     }
      //     .van-stepper {
      //       position: absolute;
      //       bottom: 0;
      //       right: 0;
      //     }
      //   }
    }
  }
}
.bottomBtn {
  width: 100%;
  height: 30px;
  //   position: relative;
  ::v-deep {
    .cloud {
      width: 92px;
      height: 30px;
      border-radius: 15px;
      border: 1px solid #dbd9de;
      span {
        width: 56px;
        height: 20px;
        font-size: 14px;
        font-family: PingFangSC-Regular, PingFang SC;
        font-weight: 400;
        color: #665e75;
        line-height: 20px;
      }
    }
  }
}
.van-button {
  float: right;
  //   position: absolute;
  //   position: absolute;
  //   left: 235px;
  width: 92px;
  height: 30px;
  border-radius: 15px;
  margin-left: 16px;
  border: 1px solid rgba(98, 44, 204, 0.8);
}
</style>
